from selenium.webdriver.common.by import By
from selenium import webdriver
import time,pytest,unittest
from ddt import ddt,file_data
@ddt
class A3mall(unittest.TestCase):
    def setUp(self)->None:
        self.driver=webdriver.Edge()
        self.driver.get('http://10.59.9.12:7001/')
        self.driver.maximize_window()
    def tearDown(self)->None:
        time.sleep(2)
        self.driver.quit()
    @file_data(r'C:\Users\30347\PycharmProjects\pythonProject1\zhoukao3_0929\po\Page\hj.json')
    def test_a3mall(self,username,password):
        self.driver.find_element(By.XPATH, '/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
        time.sleep(2)
        dy1=self.driver.find_element(By.CLASS_NAME,'reg-new').text
        print(dy1)
        self.driver.find_element(By.NAME,'username').send_keys(username)
        self.driver.find_element(By.NAME,'password').send_keys(password)
        time.sleep(10)
        self.driver.find_element(By.CSS_SELECTOR,'.finish-btn').click()
        time.sleep(2)
if __name__ == '__main__':
    unittest.main()